<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var num = prompt("欢迎使用建议计算器" + "\n" + "1.加法操作" + "\n" + "2.减法操作" + "\n" + "3.乘法操作" + "\n" + "4.除法操作" + "\n" + "5.退出" + "\n" + "请输入您的操作:")
        switch (parseInt(num)) {
            case 1:
                alert("进入加法器");
                var num1 = prompt("请输入第一个值");
                var num2 = prompt("请输入第二个值");
                alert("结果为" + (parseInt(num1) + parseInt(num2)));
                break;
            case 2:
                alert("进入减法器");
                var num1 = prompt("请输入第一个值");
                var num2 = prompt("请输入第二个值");
                alert("结果为" + (num1 - num2));
                break;
            case 3:
                alert("进入乘法器");
                var num1 = prompt("请输入第一个值");
                var num2 = prompt("请输入第二个值");
                alert("结果为" + (num1 * num2));
                break;
            case 4:
                alert("进入除法器");
                var num1 = prompt("请输入第一个值");
                var num2 = prompt("请输入第二个值");
                alert("结果为" + (num1 / num2));
                break;
            case 5:
                alert("正在退出");
                break;
        }
    </script>
</head>

<body>

</body>

</html>